/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package server;

import java.rmi.Naming;

/**
 *
 * @author apple
 */
public class Client {
    private static final String url = "";
    private static final String DEFAULT_MARKET_NAME = "Amazon";
    private static final String DEFAULT_BANK_NAME = "SEB";
    Trader trader;
    Market marketobj;
    Bank bankobj;
    private String marketname;
    private String bankname;
    
    String clientname;

    static enum CommandName {

        newTrader, getTrader, deleteTraderS, addItem, deleteItem, editItem,searchItem,buyItem,sellItem,wishItem, quit, help, list;
    };

    public Client(String bankname, String marketname, String clientname) {

    	this.bankname = bankname;
    	this.marketname = marketname;
        try {
            marketobj = (Market) Naming.lookup(marketname);
            bankobj = (Bank)Naming.lookup(bankname);
            Trader = new Trader(clientname);
        } catch (Exception e) {
            System.out.println("The runtime failed: " + e.getMessage());
            System.exit(0);
        }
        System.out.println("Connected to bank: " + bankname);
        System.out.println("Connected to market: " + marketname);
    }

    public Client(String clientname) {
    	this(DEFAULT_BANK_NAME, DEFAULT_MARKET_NAME, clientname);
    }
    
    public void run(){
    	
    }
}
